home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1984 Half 1 / rerun-1984-01-06-side-b.d64 / caves module (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  62 lines

  1. 10 lo=7680:co=30720:l=0:h=3:n=4
  2. 15 fori=900to915:readj:pokei,j:nexti
  3. 20 poke36869,255:poke251,0:poke252,0:poke253,0:poke36878,96:goto5000
  4. 50 ifp<>150thengosub3000:goto55
  5. 52 fori=7701to7921step22:pokei,33:pokei+co,5:next:poke7833,32:forj=1to50:next
  6. 54 l=l+1:p=0:print"";l:h=h-1:ifh<1thenh=4
  7. 55 poke37154,127:d=(peek(37137)and28)or(peek(37152)and128)
  8. 60 f=(peek(37137)and32)/32:p=p+1
  9. 70 ifd=156then150
  10. 80 ifd=28thenx1=x1+1:y1=y
  11. 90 ifd=152theny1=y1-1:x1=x
  12. 100 ifd=148theny1=y1+1:x1=x
  13. 110 ifd=140thenx1=x1-1:y1=y
  14. 120 ifd=24thenx1=x1+1:y1=y1-1
  15. 130 ifd=20thenx1=x1+1:y1=y1+1
  16. 140 ifx1<0orx1>21thenx1=x
  17. 150 pokelo+x+y*22,32:pokeb,32:sys7179:poke36876,0:ifpeek(lo+x1+y1*22)<>32then250
  18. 160 x=x1:y=y1:pokelo+x+y*22,38:pokelo+x+y*22+co,1
  19. 170 iff<>0andb=0then240
  20. 180 iff=0andb=0thenb=lo+x+(y+1)*22:s=235:poke36876,s:goto200
  21. 190 b=b+22
  22. 200 ifpeek(b)=39thensc=sc+40
  23. 210 ifpeek(b)<>32andpeek(b)<42thensc=sc+10:s=0:poke36876,s
  24. 215 ifpeek(b)=41thenpokeb-110,58:pokeb-110+co,2
  25. 220 ifpeek(b)<>32thenpokeb,58:b=0:s=0:poke36876,b:goto240
  26. 230 pokeb,47:pokeb+co,2:s=s-10:poke36876,s
  27. 240 print"";tab(8);sc:goto50
  28. 250 pokelo+x+y*22,58:pokelo+co+x+y*22,2
  29. 260 fori=15to0step-1:forj=15to1step-1:poke36878,96+i:poke36877,200
  30. 265 poke36879,8+i*j:nextj,i
  31. 270 n=n-1:l=l-1:ifn=-2thenprint"[147]final score"sc:poke36869,240:end
  32. 280 goto5000
  33. 3000 c=c+1:ifc>hthenc=0:a=int(rnd(1)*4)+34:goto3020
  34. 3010 a=-1
  35. 3020 ifw=42andv=3thenw=43:goto3080
  36. 3030 ifw=43andv=0thenw=42:goto3080
  37. 3040 ifrnd(1)<.7andw=42thenv=v+1:goto3080
  38. 3050 ifrnd(1)<.7andw=43thenv=v-1:goto3080
  39. 3060 ifw=42thenw=43:goto3080
  40. 3070 w=42
  41. 3080 fori=0to10:j=22*i+7701:ifi<vori>v+7thenpokej,33:pokej+co,5
  42. 3090 ifi=vthenpokej,w:pokej+co,5
  43. 3100 ifi=v+7thenpokej,w+2:pokej+co,5
  44. 3110 ifi>vandi<v+7thenpokej,32
  45. 3120 nexti
  46. 3130 ifa=34thenpoke(v+6)*22+7701,a:poke(v+6)*22+7701+co,7
  47. 3140 ifa=35thenpoke(v+6)*22+7701,a:poke(v+6)*22+7701+co,6
  48. 3150 ifa=36thenpoke(v+1)*22+7701,a:poke(v+1)*22+7701+co,4
  49. 3155 ifa=36thenpoke(v+6)*22+7701,a+5:poke(v+6)*22+7701+co,4
  50. 3160 ifa=37theni=(v+int(rnd(1)*3+1))*22+7701:pokei,a:pokei+co,9
  51. 3170 return
  52. 5000 poke36879,13:print"[147]":c=0:b=0:x=0:y=6:x1=0:y1=6:p=0
  53. 5010 fori=7922to7965:pokei,33:pokei+co,5:nexti
  54. 5020 l=l+1:print"";tab(14);"_?.?_"l
  55. 5040 printtab(7);";<=>?[157][157][157][157]"sc
  56. 5044 fori=7988to7988+n:ifn<0then5050
  57. 5046 pokei,38:pokei+co,1:nexti
  58. 5050 v=int(rnd(1)*3):w=42:forq=1to20:gosub3000:sys7179:nextq
  59. 5060 fori=7900to7812step-22:pokei,38:pokei+co,1:forj=1to500:nextj:pokei,32:nexti
  60. 5070 poke36877,250:poke36878,106:goto50
  61. 6000 data8,72,138,72,152,72,32,155,224,104,168,104,170,104,40,96
  62.